CC=gcc
CFLAGS=-W -Wall -g
LDFLAGS=
EXEC=thread fibo_thread Somme_thread
SRC= thread.c thread_self.c thread_join.c thread_exit.c thread_list.c thread_yield.c

OBJ= $(SRC:.c=.o)

all: $(EXEC)

thread: $(OBJ) exemple.c
	$(CC) -o $@ $^ $(LDFLAGS)

fibo_thread: $(OBJ) fibo_thread.o
	$(CC) -o $@ $^ $(LDFLAGS)

Somme_thread: $(OBJ) Somme_thread.o
	$(CC) -o $@ $^ $(LDFLAGS)

%.o: %.c thread.h thread_list.h
	$(CC) -o $@ -c $< $(CFLAGS)


.PHONY: clean mrproper

clean:
	rm *.o

mrproper: clean
	rm $(EXEC)
